import api from '@/libs/request'

/**
 * 获取所有展示分类
 * @param data
 */
// 获取物流地址列表
export const doGetLogisticsList = (data: any) => {
    return api.get('gruul-mall-shop/shop/logistics/address/list', data)
}
// 根据id删除地址
export const delLogisticsById = (id: string) => {
    return api.delete(`gruul-mall-shop/shop/logistics/address/del/${id}`)
}
//修改或者新增地址
export const setLogisticsDddress = (data: any) => {
    return api.post('gruul-mall-shop/shop/logistics/address/set', data)
}
/**
 * 获取物流公司列表
 */
export const doGetLogisticsCompany = () => {
    return api.get('gruul-mall-freight/fright/list', {
        current: 1,
        size: 1000,
    })
}
/**
 * 获取物流服务列表
 */
export const doGetLogisticsCompanyByShopIdList = () => {
    return api.get('gruul-mall-freight/fright/by/shopId/list')
}
/**
 * 获取物流服务收货地址
 */
export const doGetDeliveryAddress = () => {
    return api.get('gruul-mall-shop/shop/logistics/address/list', {
        current: 1,
    })
}
/**
 * 查询可用的物流服务
 * @param {*} id
 */
export const doGetLogisticsExpressUsableList = (params: any) => {
    return api.get(`gruul-mall-freight/logistics/express/usable/list`, params)
}
/**
 * 新增物流服务
 */
export const doSaveLogisticsServe = (data: any) => {
    return api.post('gruul-mall-freight/logistics/express/save', data)
}
/**
 * 获取物流服务列表
 * @param {number} current
 * @param {number} size
 */
export const doGetLogisticServeList = (current: number, size: number) => {
    return api.get('gruul-mall-freight/logistics/express/page', {
        current,
    })
}
/**
 * 修改物流服务
 * @param {any} data
 */
export const doUpdateLogisticServe = (data: any) => {
    return api.post('gruul-mall-freight/logistics/express/update', data)
}
/**
 * 删除物流服务
 */
export const doDelLogisticsServe = (ids: string) => {
    return api.delete(`gruul-mall-freight/logistics/express/del/${ids}`)
}
/**
 * 设置默认收发货地址
 * @param {*} id
 * @param {*} type
 */
export const doLogisticsSetDef = (id, type) => {
    return api.put(`gruul-mall-shop/shop/logistics/address/set/def/address/${id}/${type}`)
}
